/*
package com.xb.sourest.im;

import android.app.NotificationManager;
import android.content.Context;
import android.media.AudioManager;
import android.media.Ringtone;
import android.os.Vibrator;

import com.xb.sourest.AndroidApplication;

*/
/**
 * 新消息/通知 铃声震动提醒帮助类
 *//*

public class FCNotifyUtils {


    private FCNotifyUtils(Context context) {
        //获取铃声管理器
        mAudioMgr = (AudioManager) AndroidApplication.getApplication().getSystemService(Context.AUDIO_SERVICE);
        //获取震动管理器
        mVibratorMgr = (Vibrator) AndroidApplication.getApplication().getSystemService(Context.VIBRATOR_SERVICE);
        //创建通知栏管理对象
        mNotifyMgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    }

    private static final class FCNotifyUtilsHolder {
        private static FCNotifyUtils instance = new FCNotifyUtils(AndroidApplication.getApplication());
    }

    public static FCNotifyUtils getInstance() {
        return FCNotifyUtilsHolder.instance;
    }

    //铃声管理器
    private AudioManager mAudioMgr;
    //震动管理器
    private Vibrator mVibratorMgr;
    //上次震动时间
    private long mLastVibratorTime;
    //上次铃声时间
    private long mLastRingtongTime;
    //铃声
    private Ringtone mRingtone;
    //震动频率
    private final long[] VIBRATOR_FREQUENCY = new long[]{0, 180, 80, 120};

    //判断系统环境
    private boolean canNotify() {
        // 判断手机系统是否处于静音模式
        return mAudioMgr.getRingerMode() != AudioManager.RINGER_MODE_SILENT;
    }

    //判断震动条件
    private boolean canVibratorNotify() {
        return canNotify()
                && SpSetting.isNewMsgNoticeVibrate(AndroidApplication.getApplication())
                && System.currentTimeMillis() - mLastVibratorTime > 1000;
    }

    //判断铃声条件
    private boolean canRingtongNotify() {
        return canNotify()
                && SpSetting.isNewMsgNoticeVoice(AndroidApplication.getApplication())
                && System.currentTimeMillis() - mLastRingtongTime > 1000;
    }

    */
/**
     * 震动
     *//*

    public void vibratorNotify() {
        if (canVibratorNotify()) {
            mVibratorMgr.vibrate(VIBRATOR_FREQUENCY, -1);//-1代表震动一个周期,0代表持续循环
            mLastVibratorTime = System.currentTimeMillis();
        }
    }
}
*/
